#!/usr/bin/env bash
set -ex

PEER=${PEER:-1}

cd $(dirname $0)/..

. ./scripts/version.sh

docker run --rm --link \
    ${PROG}-dev-shell:${PROG}-server \
    --name ${PROG}-peer${PEER} \
    --hostname ${PROG}-peer${PEER} \
    -p 127.0.0.1:234${PEER}:2345 \
    -ti -e WORKSPACE=$(pwd) \
    -v ${HOME}:${HOME} \
    -v ${PROG} -w $(pwd) \
    -v ${PWD}/build/images:/var/lib/rancher/rke2/agent/images \
    --privileged -v ${PROG}-pkg:/go/pkg \
    -v ${PROG}-cache:/root/.cache/go-build ${PROG}-dev bash
